﻿using System;
using Abp.Extensions;
using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using System.ComponentModel.DataAnnotations.Schema;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace FwProject.ShoppingMall.Config
{
    /// <summary>
    /// 地区信息
    /// </summary>
    [Table("common_region")]
    public class Region : Entity<string>, ISoftDelete
    {
        public const int MaxIdLength = 20;
        public const int MaxNameLength = 256;
        public const int MaxCodeLength = 4;
        public const int MaxSpellLength = 100;
        public const int MaxInitialLength = 30;
        public const int MaxZipLength = 32;

        /// <summary>
        /// 主键(区域编码)
        /// </summary>
      
        [MaxLength(MaxIdLength)]
        [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
        public override string Id { get; set; }

        [MaxLength(MaxIdLength)]
        public string ParentId { get; set; }


        [Required]
        [MaxLength(MaxNameLength)]
        public string Name { get; set; }

        [MaxLength(MaxSpellLength)]
        public string Spell { get; set; }

        [MaxLength(MaxInitialLength)]
        public string Initial { get; set; }

        /// <summary>
        /// 电话区号
        /// </summary>
        [MaxLength(MaxCodeLength)]
        public string Code { get; set; }

        /// <summary>
        /// 邮编
        /// </summary>
    
        [MaxLength(MaxZipLength)]
        public string Zip { get; set; }

        public int Level { get; set; } = 1;

        public int Orderlist { get; set; } = 1;

        #region Soft Delete Audit
        public bool IsDeleted { get; set; }
        #endregion
    }
}